@model PollModel

<div class="panel-body">
    <div class="form-group" @(Model.AvailableLanguages.SelectionIsNotPossible() ? Html.Raw("style=\"display:none\"") : null)>
        <div class="col-md-3">
            <nop-label asp-for="LanguageId" />
        </div>
        <div class="col-md-9">
            <nop-select asp-for="LanguageId" asp-items="Model.AvailableLanguages" />
            <span asp-validation-for="LanguageId"></span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-3">
            <nop-label asp-for="Name" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="Name" asp-required="true" />
            <span asp-validation-for="Name"></span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-3">
            <nop-label asp-for="Published" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="Published" />
            <span asp-validation-for="Published"></span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-3">
            <nop-label asp-for="ShowOnHomepage" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="ShowOnHomepage" />
            <span asp-validation-for="ShowOnHomepage"></span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-3">
            <nop-label asp-for="AllowGuestsToVote" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="AllowGuestsToVote" />
            <span asp-validation-for="AllowGuestsToVote"></span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-3">
            <nop-label asp-for="StartDateUtc" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="StartDateUtc" />
            <span asp-validation-for="StartDateUtc"></span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-3">
            <nop-label asp-for="EndDateUtc" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="EndDateUtc" />
            <span asp-validation-for="EndDateUtc"></span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-3">
            <nop-label asp-for="SelectedStoreIds" />
        </div>
        <div class="col-md-9">
            <nop-select asp-for="SelectedStoreIds" asp-items="Model.AvailableStores" asp-multiple="true" />
            <script>
                $(document).ready(function() {
                    var storesIdsInput = $('#@Html.IdFor(model => model.SelectedStoreIds)').data("kendoMultiSelect");
                    storesIdsInput.setOptions({
                        autoClose: false,
                        filter: "contains"
                    });

                    @if (!Model.AvailableStores.Any())
                    {
                        <text>
                            storesIdsInput.setOptions({
                                enable: false,
                                placeholder: 'No stores available'
                            });
                            storesIdsInput._placeholder();
                            storesIdsInput._enable();
                        </text>
                    }
                });
            </script>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-3">
            <nop-label asp-for="SystemKeyword" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="SystemKeyword" />
            <span asp-validation-for="SystemKeyword"></span>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-3">
            <nop-label asp-for="DisplayOrder" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="DisplayOrder" />
            <span asp-validation-for="DisplayOrder"></span>
        </div>
    </div>
</div>